//
//  ViewController.swift
//  04snapchatMenu
//
//  Created by Clover on 2018/4/16.
//  Copyright © 2018年 youbing. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var scrollview: UIScrollView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        UIApplication.shared.isStatusBarHidden = true
        let leftVC : LeftVC = LeftVC(nibName: "LeftVC", bundle: nil)
        let cameraVC : CameraVC = CameraVC(nibName: "CameraVC", bundle: nil)
        let rightVC : RightVC = RightVC(nibName: "RightVC", bundle: nil)
        
        self.addChildViewController(leftVC)
        self.scrollview.addSubview(leftVC.view)
        
        self.addChildViewController(cameraVC)
        self.scrollview.addSubview(cameraVC.view)
        
        self.addChildViewController(rightVC)
        self.scrollview.addSubview(rightVC.view)
        
        var centerFrame = cameraVC.view.frame
        centerFrame.origin.x = self.view.frame.width
        cameraVC.view.frame = centerFrame
        
        var rightViewFrame: CGRect = rightVC.view.frame
        rightViewFrame.origin.x = 2 * self.view.frame.width
        rightVC.view.frame = rightViewFrame
        
        self.scrollview.contentSize = CGSize(width: self.view.frame.size.width * 3.0, height: self.view.frame.size.height)
    }
    
}

